package cn.ggcms.cms.dao.impl;

import java.util.List;

import cn.ggcms.cms.dao.ChannelsDao;
import cn.ggcms.cms.statics.Page;
import cn.ggcms.cms.utils.SimpleDao;
import cn.ggcms.cms.vo.Channels;

public class ChannelsImpl extends SimpleDao<Channels> implements ChannelsDao {

	public boolean doDeleteChannelsById(int id) {
		boolean flag = false;
		try {
			super.delete(Channels.class, id);
			flag = true;
		} catch (Exception e) {
			e.printStackTrace();
		}

		return flag;
	}

	public int doInsertChannels(Channels channels) {

		return super.save(channels);
	}

	public boolean doUpdateChannels(Channels channels) {
		boolean flag = false;
		try {
			super.update(channels);
			flag = true;
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		return flag;
	}

	public List<Channels> findChannels() {
		return super.setMaxResults(Page.CHANNELS).find(Channels.class);
	}

	public Channels findChannelsById(int id) {
			
		return super.get(Channels.class, id);
	}

	

}
